package cn.anlaser.status;

public enum DataEnum {
	edit("edit"), waiting("waiting"), passed("passed"), reject("reject"), delete(
			"delete");
	private String code;

	DataEnum(String code) {
		this.code = code;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public static DataEnum findBy(int num) {
		for (DataEnum userKind : DataEnum.values()) {
			if (userKind.ordinal() == num) {
				return userKind;
			}
		}
		return null;
	}

	public static DataEnum findByCode(String code) {
		for (DataEnum userKind : DataEnum.values()) {
			if (userKind.getCode().equals(code)) {
				return userKind;
			}
		}
		return null;
	}
}
